<template>
  <div id="icsr_demo">
    <el-form ref="form"  :model="model"  label-width="auto"  label-position="top">
      
      <!-- <iframe :src="urlLink" id = "iframe1" style="width: 90%; height: 50rem /* 800/16 */;"></iframe> -->
			<!--维修-->
			<WorkOrderRepair v-model="model"/>

			<!--上门服务-->
			<!-- <DoorService v-model="model"/> -->

			<!--补货-->
			<!-- <Resend v-model="model"/> -->

			<!-- 换货-->
			<!-- <ChangeGood v-model="model"/> -->

      <!--退货退款-->
      <!-- <ReceiveRefund v-model="model"></ReceiveRefund> -->

      <!--退款-->
      <!-- <Refund v-model="model"></Refund> -->
      <el-form-item style="width: 100%; text-align: center; margin-top: 20px;">
        <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </el-form-item>
    </el-form>
    
  </div>
</template>

<script>
import WorkOrderRepair from '@/components/ICSR/workOrderRepair.vue';
import ReceiveRefund from '@/components/ICSR/receiveRefund.vue';
import Refund from '@/components/ICSR/refund.vue';
import DoorService from '@/components/ICSR/doorService.vue';
import Resend from '@/components/ICSR/resend.vue';
import ChangeGood from '@/components/ICSR/changeGood.vue';

export default {
  name: 'HelloWorld',
  components: { 
		BaseForm: resolve => require(['../components/BaseForm/BaseForm'], resolve),
		WorkOrderRepair,
    ReceiveRefund,
    Refund,
		DoorService,
		Resend,
		ChangeGood
  },
  props: {
    msg: String
  },
  data() {
    const options  =  [{
          value: 'zhinan',
          label: '指南',
          children: [{
            value: 'shejiyuanze',
            label: '设计原则',
            children: [{
              value: 'yizhi',
              label: '一致'
            }, {
              value: 'fankui',
              label: '反馈'
            }, {
              value: 'xiaolv',
              label: '效率'
            }, {
              value: 'kekong',
              label: '可控'
            }]
          }, {
            value: 'daohang',
            label: '导航',
            children: [{
              value: 'cexiangdaohang',
              label: '侧向导航'
            }, {
              value: 'dingbudaohang',
              label: '顶部导航'
            }]
          }]
        }, {
          value: 'zujian',
          label: '组件',
          children: [{
            value: 'basic',
            label: 'Basic',
            children: [{
              value: 'layout',
              label: 'Layout 布局'
            }, {
              value: 'color',
              label: 'Color 色彩'
            }, {
              value: 'typography',
              label: 'Typography 字体'
            }, {
              value: 'icon',
              label: 'Icon 图标'
            }, {
              value: 'button',
              label: 'Button 按钮'
            }]
          }, {
            value: 'form',
            label: 'Form',
            children: [{
              value: 'radio',
              label: 'Radio 单选框'
            }, {
              value: 'checkbox',
              label: 'Checkbox 多选框'
            }, {
              value: 'input',
              label: 'Input 输入框'
            }, {
              value: 'input-number',
              label: 'InputNumber 计数器'
            }, {
              value: 'select',
              label: 'Select 选择器'
            }, {
              value: 'cascader',
              label: 'Cascader 级联选择器'
            }, {
              value: 'switch',
              label: 'Switch 开关'
            }, {
              value: 'slider',
              label: 'Slider 滑块'
            }, {
              value: 'time-picker',
              label: 'TimePicker 时间选择器'
            }, {
              value: 'date-picker',
              label: 'DatePicker 日期选择器'
            }, {
              value: 'datetime-picker',
              label: 'DateTimePicker 日期时间选择器'
            }, {
              value: 'upload',
              label: 'Upload 上传'
            }, {
              value: 'rate',
              label: 'Rate 评分'
            }, {
              value: 'form',
              label: 'Form 表单'
            }]
          }, {
            value: 'data',
            label: 'Data',
            children: [{
              value: 'table',
              label: 'Table 表格'
            }, {
              value: 'tag',
              label: 'Tag 标签'
            }, {
              value: 'progress',
              label: 'Progress 进度条'
            }, {
              value: 'tree',
              label: 'Tree 树形控件'
            }, {
              value: 'pagination',
              label: 'Pagination 分页'
            }, {
              value: 'badge',
              label: 'Badge 标记'
            }]
          }, {
            value: 'notice',
            label: 'Notice',
            children: [{
              value: 'alert',
              label: 'Alert 警告'
            }, {
              value: 'loading',
              label: 'Loading 加载'
            }, {
              value: 'message',
              label: 'Message 消息提示'
            }, {
              value: 'message-box',
              label: 'MessageBox 弹框'
            }, {
              value: 'notification',
              label: 'Notification 通知'
            }]
          }, {
            value: 'navigation',
            label: 'Navigation',
            children: [{
              value: 'menu',
              label: 'NavMenu 导航菜单'
            }, {
              value: 'tabs',
              label: 'Tabs 标签页'
            }, {
              value: 'breadcrumb',
              label: 'Breadcrumb 面包屑'
            }, {
              value: 'dropdown',
              label: 'Dropdown 下拉菜单'
            }, {
              value: 'steps',
              label: 'Steps 步骤条'
            }]
          }, {
            value: 'others',
            label: 'Others',
            children: [{
              value: 'dialog',
              label: 'Dialog 对话框'
            }, {
              value: 'tooltip',
              label: 'Tooltip 文字提示'
            }, {
              value: 'popover',
              label: 'Popover 弹出框'
            }, {
              value: 'card',
              label: 'Card 卡片'
            }, {
              value: 'carousel',
              label: 'Carousel 走马灯'
            }, {
              value: 'collapse',
              label: 'Collapse 折叠面板'
            }]
          }]
        }, {
          value: 'ziyuan',
          label: '资源',
          children: [{
            value: 'axure',
            label: 'Axure Components'
          }, {
            value: 'sketch',
            label: 'Sketch Templates'
          }, {
            value: 'jiaohu',
            label: '组件交互文档'
          }]
        }]
    return {
      urlLink:"http://10.107.5.12:8888/#/sso?code=709aa3f1d31b49c3bb5b4989419f8877",
      options: options,
      model: {
        text: '',
        textarea: '',
        integer: '',
        decimal: '',
        select: '',
        cascader:[],
        info: '只展示, 不可编辑',
				prop1: '',
				prop2: '',
        payType: '', // 退款方式
        collectionAccountName: '', // 收款人名称
        collectionAccount: '',// 收款账号
        vatBankAccount: '', // 开户行
        returnWay: '', // 退回方式
        onDoorDate: '', // 预约上门时间
        customerName: '', // 用户姓名
        customerPhone: '', // 联系手机
        cascaderCitys: [], // 客户地址
        addDetail: '', // 详细地址
        refundPay: '', // 申请退款金额
				servicerName: '顺丰上门取件', // 网点信息
        asmOrderReturn:{
          returnWay: '', // 退回方式
          asmPickUpNote: '', // 取件备注
          onDoorDate: '', // 预约上门时间
          customerName: '', // 用户姓名
          customerPhone: '', // 联系手机
          cascaderCitys: [], // 客户地址
          addDetail : '', // 详细地址
        },
        asmOrderSales:{
          customerName  : '', // 用户姓名
          customerPhone : '', // 联系手机
          cascaderCitys : [], // 客户地址去·
          addDetail : '', // 详细地址
        }
      },
      ref: 'form',
      formItems: [
					{
									label: '问题类型',
									prop: 'cascader',
									type: 'cascader',
									component: 'el-cascader',
									options: options,
									style: { width: '100%' }
								},
      ]
    }
  },
  mounted() {
    // setTimeout(() => {
    //   const length = this.formItems2.length;
    //   const item = this.formItems2[length - 2];
    //   item.options.forEach(element => {
    //     if (element.label === '指南') {
    //       element.label = '指南2'
    //     }
    //   });
    // }, 1000)
  },
  methods: {
    submitForm() {
      debugger
      this.$refs[form].validate(valid => {
        if (valid) {
          alert('submit!')
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    resetForm() {
      this.$refs[this.ref].resetFields()
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
